﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace BanHangCshap.Class.gkhtdl63.DAL
{
    public abstract class BoSanphamDAL: clsBaseDAL
    {
        public DataTable BoSanpham_LayDanhsach()
        {
            return base.Select("sp_BoSanpham_LayDanhsach");
        }

        public DataTable BoSanpham_LayTheoma(string xlMa)
        {
            string xlSPName = "sp_BoSanpham_LayTheoma";
            string[] xlSPPara = { "@Ma" };
            string[] xlSPValu = { xlMa };
            return base.Select(xlSPName, xlSPPara, xlSPValu);
        }

        public bool BoSanpham_Xoa(string xlMa)
        {
            string xlSPName = "sp_BoSanpham_Xoa";
            string[] xlSPPara = { "@Ma" };
            string[] xlSPValu = { xlMa };
            return base.Delete(xlSPName, xlSPPara, xlSPValu);
        }

        public bool BoSanpham_Them(DAL.Entities.BoSanpham xlBSP)
        {
            string xlSPName = "sp_BoSanpham_Them";
            string[] xlSPPara = {   "@Ma"
                                    ,"@Ma_LoaiBoSanpham"
                                    ,"@Ten"
                                    ,"@Mota"
                                    ,"@MaNguoidung"
                                    ,"@Ngaytao"
                                };

            object[] xlSPValu = {   xlBSP.Ma
                                    ,xlBSP.Ma_LoaiBoSanpham
                                    ,xlBSP.Ten
                                    ,xlBSP.Mota
                                    ,xlBSP.MaNguoidung
                                    ,xlBSP.Ngaytao
                                 };
            return base.Insert(xlSPName, xlSPPara, xlSPValu);
        }

        public bool BoSanpham_Capnhat(string xlMacu, DAL.Entities.BoSanpham xlBSP)
        {
            string xlSPName = "sp_BoSanpham_Capnhat";
            string[] xlSPPara = {   "@Macu"
                                    ,"@Ma"
                                    ,"@Ma_LoaiBoSanpham"
                                    ,"@Ten"
                                    ,"@Mota"
                                };

            object[] xlSPValu = {   xlMacu
                                    ,xlBSP.Ma
                                    ,xlBSP.Ma_LoaiBoSanpham
                                    ,xlBSP.Ten
                                    ,xlBSP.Mota
                                 };
            return base.Update(xlSPName, xlSPPara, xlSPValu);
        }
    }
}
